package config

import (
	"192.168.1.75/go-pkg/gormx"
	"192.168.1.75/go-pkg/logx"
	"192.168.1.75/go-pkg/redisx"
)

var Config ConfigType

type ConfigType struct {
	// 对外http接口端口
	HTTPPort string `mapstructure:"http_port"`
	// grpc端口
	GRPCPort string `mapstructure:"grpc_port"`
	// mysql配置
	Mysql gormx.Config `mapstructure:"mysql"`
	// 自动数据迁移检查
	AutoMigrate bool `mapstructure:"auto_migrate"`
	// 禁止重启检查，主要用于本地开发
	DisableRestartCheck bool `mapstructure:"disable_restart_check"`
	// redis 配置
	Redis redisx.Config `mapstructure:"redis"`
	// 日志配置
	Log logx.Config `mapstructure:"log"`
	// 文件保存路径
	FileSaveDir string `mapstructure:"file_save_dir"`
	// 本地服务,serviceName-serviceConf【ip:http_port:grpc_port】
	LocalServices   map[string]string `mapstructure:"local_services"`
	AlipayNotifyUrl string            `mapstructure:"alipay_notify_url"`
	WechatNotifyUrl string            `mapstructure:"wechat_notify_url"`
	BaseUrl         string            `mapstructure:"base_url"`
	LogTracing      bool              `mapstructure:"log_tracing"`
	SMSTemplateCode string            `mapstructure:"sms_template_code"`
	WechatMini      struct {
		AppID  string `mapstructure:"app_id"`
		Secret string `mapstructure:"secret"`
	} `mapstructure:"wechat_mini"`
	WechatMiniAdvertisement struct {
		AppID  string `mapstructure:"app_id"`
		Secret string `mapstructure:"secret"`
	} `mapstructure:"wechat_mini_advertisement"`
	WanxiangPoints struct {
		AuthURL   string `mapstructure:"auth_url"`
		BaseURL   string `mapstructure:"base_url"`
		AppID     string `mapstructure:"app_id"`
		APPSecret string `mapstructure:"app_secret"`
	} `mapstructure:"wanxiang_points"`
	WechatV3Config struct {
		MchID        string `mapstructure:"mch_id"`
		SerialNo     string `mapstructure:"serial_no"`
		APIv3Key     string `mapstructure:"apiv3_key"`
		ApiclientKey string `mapstructure:"apiclient_key"`
	} `mapstructure:"wechat_v3_config"`
	MerchantID string `mapstructure:"merchant_id"`
	EnvType    string `mapstructure:"env_type"`
}
